<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.3/css/all.min.css" integrity="sha256-2H3fkXt6FEmrReK448mDVGKb3WW2ZZw35gI7vqHOE4Y=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/animate.css@3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"example.com","root":"/","images":"/images","scheme":"Pisces","version":"8.7.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":false,"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"Searching...","empty":"We didn't find any results for the search: ${query}","hits_time":"${hits} results found in ${time} ms","hits":"${hits} results found"}}</script><script src="/js/config.js"></script>
<meta name="description" content="es6promise&#x2F;generator&#x2F;async&#x2F;await箭头函数是什么 function的一种简化  何时用 简化函数，凡是用到函数的时候就可以用  怎么用 无参数  &lt;ol&gt;&lt;li&gt;（）&#x3D;&gt;{&amp;nbsp; &amp;nbsp;}&lt;br&gt;&lt;&#x2F;li&gt;&lt;&#x2F;ol&gt;   有多个参数时  const&amp;nbsp; fun&#x3D;(a,b,c)&#x3D;&amp;gt">
<meta property="og:type" content="article">
<meta property="og:title" content="Es6">
<meta property="og:url" content="http://example.com/2020/11/12/es6/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="es6promise&#x2F;generator&#x2F;async&#x2F;await箭头函数是什么 function的一种简化  何时用 简化函数，凡是用到函数的时候就可以用  怎么用 无参数  &lt;ol&gt;&lt;li&gt;（）&#x3D;&gt;{&amp;nbsp; &amp;nbsp;}&lt;br&gt;&lt;&#x2F;li&gt;&lt;&#x2F;ol&gt;   有多个参数时  const&amp;nbsp; fun&#x3D;(a,b,c)&#x3D;&amp;gt">
<meta property="og:locale" content="en_US">
<meta property="article:published_time" content="2020-11-12T09:20:05.000Z">
<meta property="article:modified_time" content="2021-07-15T07:14:17.528Z">
<meta property="article:author" content="John Doe">
<meta name="twitter:card" content="summary">


<link rel="canonical" href="http://example.com/2020/11/12/es6/">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"en","comments":true,"permalink":"http://example.com/2020/11/12/es6/","path":"2020/11/12/es6/","title":"Es6"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>Es6 | Hexo</title>
  




  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="Toggle navigation bar" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <h1 class="site-title">Hexo</h1>
      <i class="logo-line"></i>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu">
        <li class="menu-item menu-item-首页"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li>
        <li class="menu-item menu-item-分类"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a></li>
        <li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>Archives</a></li>
  </ul>
</nav>




</div>
        
  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          Table of Contents
        </li>
        <li class="sidebar-nav-overview">
          Overview
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#es6"><span class="nav-number">1.</span> <span class="nav-text">es6</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#promise-generator-async-await"><span class="nav-number">1.1.</span> <span class="nav-text">promise&#x2F;generator&#x2F;async&#x2F;await</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%AE%AD%E5%A4%B4%E5%87%BD%E6%95%B0"><span class="nav-number">1.2.</span> <span class="nav-text">箭头函数</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%98%AF%E4%BB%80%E4%B9%88"><span class="nav-number">1.2.1.</span> <span class="nav-text">是什么</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%BD%95%E6%97%B6%E7%94%A8"><span class="nav-number">1.2.2.</span> <span class="nav-text">何时用</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%80%8E%E4%B9%88%E7%94%A8"><span class="nav-number">1.2.3.</span> <span class="nav-text">怎么用</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F"><span class="nav-number">1.3.</span> <span class="nav-text">正则表达式</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%BB%80%E4%B9%88%E6%98%AF"><span class="nav-number">1.3.1.</span> <span class="nav-text">什么是</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%BB%80%E4%B9%88%E6%97%B6%E5%80%99%E7%94%A8"><span class="nav-number">1.3.2.</span> <span class="nav-text">什么时候用</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%80%8E%E4%B9%88%E7%94%A8-1"><span class="nav-number">1.3.3.</span> <span class="nav-text">怎么用</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%BD%9C%E7%94%A8%E5%9F%9F"><span class="nav-number">1.4.</span> <span class="nav-text">作用域</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%9D%97%E7%BA%A7%E4%BD%9C%E7%94%A8%E5%9F%9F"><span class="nav-number">1.4.1.</span> <span class="nav-text">块级作用域</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#var"><span class="nav-number">1.4.2.</span> <span class="nav-text">var</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#this%E6%8C%87%E5%90%91"><span class="nav-number">1.5.</span> <span class="nav-text">this指向</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%8C%87%E5%90%91%E8%B0%81"><span class="nav-number">1.5.1.</span> <span class="nav-text">指向谁</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link"><span class="nav-number">1.6.</span> <span class="nav-text">.  .   .</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%AE%9E%E7%8E%B0%E5%AF%B9%E5%AF%B9%E8%B1%A1%E7%9A%84%E6%B7%B1%E6%8B%B7%E8%B4%9D"><span class="nav-number">1.6.1.</span> <span class="nav-text">实现对对象的深拷贝</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%B0%86%E6%95%B0%E7%BB%84%E8%BD%AC%E4%B8%BA%E7%94%B1%E9%80%97%E5%8F%B7%E9%9A%94%E5%BC%80%E7%9A%84%E5%BA%8F%E5%88%97%EF%BC%8C%E5%90%8C%E6%97%B6%E5%8F%88%E5%8F%AF%E4%BB%A5%E5%AE%9E%E7%8E%B0%E6%8B%B7%E8%B4%9D"><span class="nav-number">1.6.2.</span> <span class="nav-text">将数组转为由逗号隔开的序列，同时又可以实现拷贝</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%BC%A0%E9%80%92%E5%BD%A2%E5%8F%82%E6%97%B6%E7%94%A8"><span class="nav-number">1.6.3.</span> <span class="nav-text">传递形参时用</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E8%A7%A3%E6%9E%84"><span class="nav-number">1.7.</span> <span class="nav-text">解构</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%80%8E%E4%B9%88%E7%94%A8-2"><span class="nav-number">1.7.1.</span> <span class="nav-text">怎么用</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E8%AF%B4%E4%BA%BA%E8%AF%9D"><span class="nav-number">1.7.2.</span> <span class="nav-text">说人话</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%9B%B4%E9%AB%98%E7%AB%AF%E5%A4%A7%E6%B0%94"><span class="nav-number">1.7.3.</span> <span class="nav-text">更高端大气</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E6%80%8E%E6%A0%B7%E5%B0%86%E7%B1%BB%E6%95%B0%E7%BB%84%E8%BD%AC%E4%B8%BA%E7%9C%9F%E6%AD%A3%E7%9A%84%E6%95%B0%E7%BB%84"><span class="nav-number">1.8.</span> <span class="nav-text">怎样将类数组转为真正的数组</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#Array-from-%E7%B1%BB%E6%95%B0%E7%BB%84"><span class="nav-number">1.8.1.</span> <span class="nav-text">Array.from(类数组)</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E9%99%A4%E8%BF%87es6%E4%BB%A5%E5%A4%96%E8%BF%98%E6%9C%89%E4%BB%80%E4%B9%88%E6%96%B9%E6%B3%95"><span class="nav-number">1.8.2.</span> <span class="nav-text">除过es6以外还有什么方法</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Map%EF%BC%88%EF%BC%89"><span class="nav-number">1.9.</span> <span class="nav-text">Map（）</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%AE%83%E8%A7%A3%E5%86%B3%E4%BA%86%E4%BB%80%E4%B9%88%E9%97%AE%E9%A2%98"><span class="nav-number">1.9.1.</span> <span class="nav-text">它解决了什么问题</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%BB%80%E4%B9%88%E6%97%B6%E5%80%99%E7%94%A8%E4%B8%80%E6%97%A6%E5%87%BA%E7%8E%B0%E9%9C%80%E8%A6%81%E5%AD%98%E5%82%A8%E4%B8%80%E5%AF%B9%E9%94%AE%E5%80%BC%E5%AF%B9%EF%BC%8C%E7%AB%8B%E5%88%BB%E9%A6%96%E5%85%88%E6%83%B3%E5%88%B0Map%E8%BF%99%E4%B8%AA%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84"><span class="nav-number">1.9.2.</span> <span class="nav-text">什么时候用一旦出现需要存储一对键值对，立刻首先想到Map这个数据结构</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E9%82%A3%E5%AE%83%E6%9C%89%E5%93%AA%E4%BA%9B%E6%96%B9%E6%B3%95"><span class="nav-number">1.9.3.</span> <span class="nav-text">那它有哪些方法</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Set"><span class="nav-number">1.10.</span> <span class="nav-text">Set()</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%B8%80%E6%97%A6%E9%A2%98%E7%9B%AE%E4%B8%AD%E6%B6%89%E5%8F%8A%E9%9B%86%E5%90%88%E7%AB%8B%E5%88%BB%E6%83%B3%E5%88%B0set"><span class="nav-number">1.10.1.</span> <span class="nav-text">一旦题目中涉及集合立刻想到set</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Set%E5%81%9A%E4%BA%86%E5%93%AA%E4%BA%9B%E4%BA%8B%E6%83%85"><span class="nav-number">1.10.2.</span> <span class="nav-text">Set做了哪些事情</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E8%83%BD%E5%81%9A%E5%88%B0%E4%BB%80%E4%B9%88"><span class="nav-number">1.10.3.</span> <span class="nav-text">能做到什么</span></a></li></ol></li></ol></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-overview">
            <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">John Doe</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap site-overview-item animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">20</span>
          <span class="site-state-item-name">posts</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">12</span>
        <span class="site-state-item-name">categories</span></a>
      </div>
  </nav>
</div>



          </div>
        </div>
      </div>
    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    
  <div class="back-to-top" role="button" aria-label="Back to top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="en">
    <link itemprop="mainEntityOfPage" href="http://example.com/2020/11/12/es6/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="John Doe">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Hexo">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Es6
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">Posted on</span>

      <time title="Created: 2020-11-12 17:20:05" itemprop="dateCreated datePublished" datetime="2020-11-12T17:20:05+08:00">2020-11-12</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">In</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/ex6/" itemprop="url" rel="index"><span itemprop="name">ex6</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <h1 id="es6"><a href="#es6" class="headerlink" title="es6"></a>es6</h1><h2 id="promise-generator-async-await"><a href="#promise-generator-async-await" class="headerlink" title="promise/generator/async/await"></a>promise/generator/async/await</h2><h2 id="箭头函数"><a href="#箭头函数" class="headerlink" title="箭头函数"></a>箭头函数</h2><h3 id="是什么"><a href="#是什么" class="headerlink" title="是什么"></a>是什么</h3><ul>
<li>function的一种简化</li>
</ul>
<h3 id="何时用"><a href="#何时用" class="headerlink" title="何时用"></a>何时用</h3><ul>
<li>简化函数，凡是用到函数的时候就可以用</li>
</ul>
<h3 id="怎么用"><a href="#怎么用" class="headerlink" title="怎么用"></a>怎么用</h3><ul>
<li><p>无参数</p>
<ul>
<li>&lt;ol&gt;&lt;li&gt;（）=&gt;{&nbsp; &nbsp;}&lt;br&gt;&lt;/li&gt;&lt;/ol&gt;</li>
</ul>
</li>
<li><p>有多个参数时</p>
<ul>
<li><p>const&nbsp; fun=(a,b,c)=&gt;{&nbsp; return 函数体}</p>
<ul>
<li>注意要得到函数返回值别把return忘记</li>
</ul>
</li>
</ul>
</li>
</ul>
<h2 id="正则表达式"><a href="#正则表达式" class="headerlink" title="正则表达式"></a>正则表达式</h2><h3 id="什么是"><a href="#什么是" class="headerlink" title="什么是"></a>什么是</h3><ul>
<li>限制用户所输入的信息，的表达式</li>
</ul>
<h3 id="什么时候用"><a href="#什么时候用" class="headerlink" title="什么时候用"></a>什么时候用</h3><ul>
<li><p>表单验证</p>
</li>
<li><p>用户名输入的时候</p>
<ul>
<li>子主题</li>
</ul>
</li>
<li><p>对于密码验证的时候</p>
</li>
</ul>
<h3 id="怎么用-1"><a href="#怎么用-1" class="headerlink" title="怎么用"></a>怎么用</h3><ul>
<li><p>起止符</p>
<ul>
<li>^ 开始符号</li>
<li>&amp;结束符</li>
</ul>
</li>
<li><p>多选一符号</p>
<ul>
<li>[  ]</li>
</ul>
</li>
<li><p>组合符号 ^[^A-Z0-9${2,3} ]</p>
<ul>
<li>后面花括号代表的是从前面选2-3个元素；</li>
</ul>
</li>
</ul>
<h2 id="作用域"><a href="#作用域" class="headerlink" title="作用域"></a>作用域</h2><h3 id="块级作用域"><a href="#块级作用域" class="headerlink" title="块级作用域"></a>块级作用域</h3><ul>
<li><p>const</p>
<ul>
<li><p>这个和let的最大的区别就是，const不可以先只声明</p>
<ul>
<li><p>为什么</p>
<ul>
<li>const所定义的是一个定值，如果你只声明不赋值，如何做到是一个定值，感觉有点勉强</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li><p>let </p>
<ul>
<li>Subtopic</li>
</ul>
</li>
<li><p>它首先解决了var变量提升的问题</p>
<ul>
<li>它怎么解决这个问题的，将全局执行上下文的创建阶段和执行阶段时机同步了所以不会再出现变量提升的问题</li>
<li>它还解决了，var没有作用域的问题</li>
</ul>
</li>
<li><p>由块级作用域，引发了一个问题就是暂时性死区</p>
<ul>
<li><p>什么时候会引发暂时性死区</p>
<ul>
<li><p>条件</p>
<ul>
<li>如果在一个块级作用域里存在let,那么此时let所处的作用域就会锁死</li>
</ul>
</li>
<li><p>一旦在变量let声明前,去使用就会为undefined</p>
</li>
<li><p>那我什么时候能用，只有到声明后才可以去使用let/或const所声明的变量</p>
</li>
<li><p>那具体暂时性死区是什么</p>
<ul>
<li>其实就是let/const声明前的代码区域（在块级作用域中）</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h3 id="var"><a href="#var" class="headerlink" title="var"></a>var</h3><ul>
<li><p>没有块级作用域</p>
<ul>
<li><p>那如果没有块级作用域会引发哪些问题</p>
<ul>
<li><p>在函数中用var声明的变量，函数外部可以访问，这个就很危险</p>
</li>
<li><p>也会引发变量提升的问题</p>
<ul>
<li>根据你在声明变量的时候，会出现执行上下文，而创建上下文的创建与执行阶段是不同步的所以造成了变量提升</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h2 id="this指向"><a href="#this指向" class="headerlink" title="this指向"></a>this指向</h2><h3 id="指向谁"><a href="#指向谁" class="headerlink" title="指向谁"></a>指向谁</h3><ul>
<li>在函数 的内部，</li>
</ul>
<h2 id=""><a href="#" class="headerlink" title=".  .   ."></a>.  .   .</h2><h3 id="实现对对象的深拷贝"><a href="#实现对对象的深拷贝" class="headerlink" title="实现对对象的深拷贝"></a>实现对对象的深拷贝</h3><h3 id="将数组转为由逗号隔开的序列，同时又可以实现拷贝"><a href="#将数组转为由逗号隔开的序列，同时又可以实现拷贝" class="headerlink" title="将数组转为由逗号隔开的序列，同时又可以实现拷贝"></a>将数组转为由逗号隔开的序列，同时又可以实现拷贝</h3><h3 id="传递形参时用"><a href="#传递形参时用" class="headerlink" title="传递形参时用"></a>传递形参时用</h3><ul>
<li>如果你并不知道参数有几个的时候？？？</li>
</ul>
<h2 id="解构"><a href="#解构" class="headerlink" title="解构"></a>解构</h2><h3 id="怎么用-2"><a href="#怎么用-2" class="headerlink" title="怎么用"></a>怎么用</h3><ul>
<li>需要从一些对象（也可解构多层嵌套对象）</li>
</ul>
<h3 id="说人话"><a href="#说人话" class="headerlink" title="说人话"></a>说人话</h3><ul>
<li><p>获取对象里的值</p>
<ul>
<li>根据对象里的键来获取值</li>
</ul>
</li>
</ul>
<h3 id="更高端大气"><a href="#更高端大气" class="headerlink" title="更高端大气"></a>更高端大气</h3><h2 id="怎样将类数组转为真正的数组"><a href="#怎样将类数组转为真正的数组" class="headerlink" title="怎样将类数组转为真正的数组"></a>怎样将类数组转为真正的数组</h2><h3 id="Array-from-类数组"><a href="#Array-from-类数组" class="headerlink" title="Array.from(类数组)"></a>Array.from(类数组)</h3><h3 id="除过es6以外还有什么方法"><a href="#除过es6以外还有什么方法" class="headerlink" title="除过es6以外还有什么方法"></a>除过es6以外还有什么方法</h3><ul>
<li><p>Array.prototype.slice( ).call(类数组）</p>
<ul>
<li>这个不理解</li>
</ul>
</li>
</ul>
<h2 id="Map（）"><a href="#Map（）" class="headerlink" title="Map（）"></a>Map（）</h2><h3 id="它解决了什么问题"><a href="#它解决了什么问题" class="headerlink" title="它解决了什么问题"></a>它解决了什么问题</h3><ul>
<li>专门用来存储键值对的</li>
</ul>
<h3 id="什么时候用一旦出现需要存储一对键值对，立刻首先想到Map这个数据结构"><a href="#什么时候用一旦出现需要存储一对键值对，立刻首先想到Map这个数据结构" class="headerlink" title="什么时候用一旦出现需要存储一对键值对，立刻首先想到Map这个数据结构"></a>什么时候用一旦出现需要存储一对键值对，立刻首先想到Map这个数据结构</h3><h3 id="那它有哪些方法"><a href="#那它有哪些方法" class="headerlink" title="那它有哪些方法"></a>那它有哪些方法</h3><ul>
<li><p>set(键，值）</p>
<ul>
<li>这个返回的是新的map数据结构，包含有新的设置的键值对</li>
</ul>
</li>
<li><p>has(键）</p>
<ul>
<li><p>返回值为布尔值</p>
<ul>
<li>目的是为了判断是否存在当前键//这个主要判断是否有对应的键</li>
</ul>
</li>
</ul>
</li>
<li><p>delete(键)</p>
<ul>
<li>删除键所对应的键值对</li>
</ul>
</li>
<li><p>get(键）</p>
<ul>
<li><p>这个是在获取键所对应的值</p>
<ul>
<li>这个在力扣第一题中用到它了</li>
</ul>
</li>
</ul>
</li>
</ul>
<h2 id="Set"><a href="#Set" class="headerlink" title="Set()"></a>Set()</h2><h3 id="一旦题目中涉及集合立刻想到set"><a href="#一旦题目中涉及集合立刻想到set" class="headerlink" title="一旦题目中涉及集合立刻想到set"></a>一旦题目中涉及集合立刻想到set</h3><ul>
<li>特点就是，一旦题目提到有序，无重复元素，立刻反应Set()</li>
</ul>
<h3 id="Set做了哪些事情"><a href="#Set做了哪些事情" class="headerlink" title="Set做了哪些事情"></a>Set做了哪些事情</h3><ul>
<li><p>给定一个数组</p>
<ul>
<li>返回一个没有重复序列的集合</li>
</ul>
</li>
</ul>
<h3 id="能做到什么"><a href="#能做到什么" class="headerlink" title="能做到什么"></a>能做到什么</h3><ul>
<li><p>数组去重</p>
<ul>
<li><p>首先通过，[…set(arry)]</p>
<ul>
<li>但是我对于这个有一些问题就是，首先通过…元素是否意思是将set数据结构转为数组，那如果已经是数组了为什么要在加上数组字面量不理解</li>
</ul>
</li>
</ul>
</li>
<li><p>求交集</p>
<ul>
<li>怎么做</li>
</ul>
</li>
</ul>

    </div>

    
    
    

    <footer class="post-footer">

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/2020/09/15/HTML%E4%BD%93%E7%B3%BB/" rel="prev" title="HTML">
                  <i class="fa fa-chevron-left"></i> HTML
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/2020/12/01/V8%E5%BC%95%E6%93%8E%E5%A6%82%E4%BD%95%E6%89%A7%E8%A1%8C%E4%B8%80%E6%AE%B5%E4%BB%A3%E7%A0%81/" rel="next" title="V8引擎执行代码">
                  V8引擎执行代码 <i class="fa fa-chevron-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">John Doe</span>
</div>
  <div class="powered-by">Powered by <a href="https://hexo.io/" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/pisces/" rel="noopener" target="_blank">NexT.Pisces</a>
  </div>

    </div>
  </footer>

  
  <script src="https://cdn.jsdelivr.net/npm/animejs@3.2.1/lib/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script>

  




  





</body>
</html>
